export function calendarList(req, res) {
  console.log(`date: ${req.query.date}`);
  return null;
}

export function calendarDetail(req, res) {
  console.log(`Tag id : ${req.query.id}`);
  return null;
}

export function ApplyHoliday(req, res) {
  const { date, category, reason, url } = this.body;
  console.log(
    `
    date:  ${date}  //要申请假期的日期
    category: ${category} // 假期的种类
    reason: ${reason} // 理由
    url: ${url} // 相关证明的url
    `
  );
  res.send({
    success: true,
  });
}

export function HolidayList(req, res) {
  console.log(`uid:  ${req.query.uid}`);
  const result = {
    total: 6,
    results: [{
      id: 'holidayId:4657132461123164',
      date: '2018-09-20',
      process: [{
        title: '用户名(DZJ)',
        subtitle: '申请已提交，请等待领导的审批',
        state: 1,
      },{
        title: '主管',
        subtitle: '审批中..',
        state: 2,
      },{
        title: '总经理',
        subtitle: '等待..',
        state: 3,
      }]
    }, {
      id: 'holidayId:44456664545',
      date: '2018-07-04',
      process: [{
        title: '用户名(DZJ)',
        subtitle: '申请已提交，请等待领导的审批',
        state: 1,
      },{
        title: '主管',
        subtitle: '已通过..',
        state: 1,
      },{
        title: '总经理',
        subtitle: '已通过..',
        state: 1,
      },{
        title: '结果',
        subtitle: '申请通过..',
        state: 1,
      }]
    }, {
      id: 'holidayId:318797869589799',
      date: '2018-04-05',
      process: [{
        title: '用户名(DZJ)',
        subtitle: '申请已提交，请等待领导的审批',
        state: 1,
      },{
        title: '主管',
        subtitle: '拒绝申请..原因：最近业务繁忙',
        state: 4,
      },{
        title: '结果',
        subtitle: '申请被拒绝..',
        state: 3,
      }]
    }],
  };
  res.send(result);
}

export function FoodDetail(req, res) {
  console.log(`date:  ${req.query.date}  //要申请假期的日期`);
  res.send({
    breakfast: ['豆浆/油条','白粥/油条'],
    lunch: ['黄焖鸡米饭','土豆牛肉咖喱饭'],
    dinner: ['芹菜炒鸡胗','白切鸡'],
  });
}

export function BookFood(req, res) {
  const { date, food, time } = this.body;
  console.log(
    `
    date:  ${date}  //要申请假期的日期
    food: ${food} // 菜品
    time: ${time} // 时间段
    `
  );
  res.send({
    success: true,
  });
}

export function FoodList(req, res) {
  console.log(`uid:  ${req.query.uid}`);
  const result = {
    total: 10,
    results: [{
      id: 'foodId: 654613246545613223',
      date: '2018-09-20',
      food: [{
        time: '早餐',
        name: '豆浆/油条',
      }, {
        time: '午餐',
        name: '黄焖鸡米饭',
      }],
    }, {
      id: 'foodId: 123123333221',
      date: '2018-07-04',
      food: [{
        time: '午餐',
        name: '黄焖鸡米饭',
      }],
    }, {
      id: 'foodId: 333232332222',
      date: '2018-04-05',
      food: [{
        time: '早餐',
        name: '白粥/油条',
      }, {
        time: '午餐',
        name: '土豆牛肉咖喱饭',
      }, {
        time: '晚餐',
        name: '芹菜炒鸡胗',
      }],
    }]

  };
  res.send(result);
}
